<?php
// +----------------------------------------------------------------------
// | Copyright © Sogu Technologies Co. Ltd 2018-2050 All rights reserved.
// +----------------------------------------------------------------------
// | File name: LoanApply.php
// +----------------------------------------------------------------------
// | Author: gxs
// +----------------------------------------------------------------------
// | Description: 原卡贷申请表模型
// +----------------------------------------------------------------------
// | Others: 其他内容的说明
// +----------------------------------------------------------------------
// | History: 修改历史记录列表，每条修改记录应包含修改日期、修改者及修改内容简述
// +----------------------------------------------------------------------
// | 1.Date: 2019/2/27 Author: gxs Modification: 创建
// +----------------------------------------------------------------------

namespace App\ModelTransfers\WsLoans;

use App\ModelTransfers\Base;
use App\ModelTransfers\Traits\LoanApplyTrait;
use App\ModelTransfers\WsAccount\PayBindCard;
use App\ModelTransfers\WsFund\WsFund;
use App\ModelTransfers\WsXinLiu\WsXinLiu;

class LoanApply extends Base
{
    use LoanApplyTrait;
    protected $table = 'ws_loan.loan_apply';

    /**
     * Description:晋商授信信息
     * Author: Sam
     * DateTime: 2019-02-28 15:05
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function wsFund()
    {
        return $this->hasOne(WsFund::class,'apply_id','id');
    }

    /**
     * Description:光大授信信息
     * Author: Sam
     * DateTime: 2019-02-28 15:06
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function wsXinLiu()
    {
        return $this->hasOne(WsXinLiu::class,'apply_id','id');
    }

    /**
     * Description:储蓄卡
     * Author: Sam
     * DateTime: 2019-02-28 16:19
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function cash_card()
    {
        return $this->hasOne(PayBindCard::class,'id','bank_card_id');
    }

    /**
     * Description:信用卡
     * Author: Sam
     * DateTime: 2019-02-28 16:20
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function credit_card()
    {
        return $this->hasOne(PayBindCard::class,'id','credit_card_id');
    }
}